package com.dy.placeOrder.util;

import java.util.HashMap;
import java.util.Map;

//前缀树
public class TrieNode{

    //关键词结束标识
    private boolean isKeywordEnd = false;

    //子节点
    private Map<Character,TrieNode> subNodes = new HashMap<>();

    //isKeywordEnd的get、set方法
    public boolean isKeywordEnd() {

        return isKeywordEnd;
    }

    public void setKeywordEnd(boolean keywordEnd) {

        isKeywordEnd = keywordEnd;
    }

    //添加子节点
    public void addSubNode(Character c,TrieNode node){

        subNodes.put(c,node);
    }

    //获取子节点
    public TrieNode getSubNode(Character c){

        return subNodes.get(c);
    }
}
